﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace BluSteamServer.Model
{
    public class KickUserCommand : Command
    {
        private readonly string _username;

        public KickUserCommand(string username)
        {
            _username = username;
        }

        public void Execute()
        {
            //User user = null;
            //using (var context = new BluSteamEntities.EntityModelContainer())
            //{
            //    var query = from u in context.Users where u.Username == "Drewan" select u;
            //    user = query.FirstOrDefault();
            //}

            // check if the user is still online
            if (ConnectionManager.Instance.IsConnected(_username))
            {
                ConnectionManager.Instance.RemoveConnection(_username);
            }
        }
    }
}
